/*
 * @Descripttion: 用于配置vuex相关
 * @version: 
 * @@Company: None
 * @Author: 孤鹜
 * @Date: 2022-01-27 08:33:45
 * @LastEditors: 孤鹜
 * @LastEditTime: 2022-01-28 08:23:20
 */
import Vue from "vue";
import Vuex from "vuex"

Vue.use(Vuex)

const store = new Vuex.Store({
  state: {
    user_img: require("../assets/avator.jpg"),  // 用户头像地址
    user_name: 'user_name',
    user_type: '教师' // 教师  或  学生,
  },
  mutations: {
    // 修改 user_img
    loadUserImg(state, URL) {
      state.user_img = URL
    },
    // 修改 user_name
    loadUserName(state, name) {
      state.user_name = name
    },
    // 修改 user_type
    loadUserType(state, type) {
      state.user_type = type
    }
  },
  actions: {},
  getters: {},
  modules: {}
})

export default store